USE [SONALIKA_BGK_UPDATED]
GO

/****** Object:  Table [dbo].[TRACTOR_PARTS]    Script Date: 13-May-14 1:04:49 AM ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[TRACTOR_PARTS](
	[TRACTOR_PART_ID] [int] IDENTITY(1,1) NOT NULL,
	[TRACTOR_ID] [int] NOT NULL,
	[PART_MAKER] [varchar](50) NOT NULL,
	[PART_SIZE] [varchar](50) NOT NULL,
	[PART_SERIAL_NO] [varchar](50) NOT NULL,
	[PART_REMARKS] [varchar](100) NULL,
	[PART_TYPE] [int] NOT NULL,
 CONSTRAINT [PK_TRACTOR_PARTS] PRIMARY KEY CLUSTERED 
(
	[TRACTOR_PART_ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [dbo].[TRACTOR_PARTS]  WITH CHECK ADD  CONSTRAINT [FK_TRACTOR_PARTS_MASTER] FOREIGN KEY([PART_TYPE])
REFERENCES [dbo].[MASTER] ([MASTER_ID])
GO

ALTER TABLE [dbo].[TRACTOR_PARTS] CHECK CONSTRAINT [FK_TRACTOR_PARTS_MASTER]
GO

ALTER TABLE [dbo].[TRACTOR_PARTS]  WITH CHECK ADD  CONSTRAINT [FK_TRACTOR_PARTS_TRACTOR_PURCHASES] FOREIGN KEY([TRACTOR_ID])
REFERENCES [dbo].[TRACTOR_PURCHASES] ([TRACTOR_ID])
GO

ALTER TABLE [dbo].[TRACTOR_PARTS] CHECK CONSTRAINT [FK_TRACTOR_PARTS_TRACTOR_PURCHASES]
GO


